package ltd.bugs.tool.signature.factory;

import ltd.bugs.tool.signature.factory.impl.CompanyGeneralSignature;
import ltd.bugs.tool.signature.factory.impl.PersonalGeneralSignature;
import ltd.bugs.tool.signature.factory.impl.PersonalSuffixSignature;

/**
 * @author zhengzhq
 * @Title: SignatureFactory
 * @Description: 签名工厂类，根据不同的类型获取对应的实现节点
 * @date 2018/8/9下午6:25
 */
public class SignatureFactory {

  public static Signature getInstance(SignatureTypes type) {
    switch (type) {
      case COMPANY_GENERAL:
        return new CompanyGeneralSignature();

      case PERSONAL_GENERAL:
        return new PersonalGeneralSignature();

      case PERSONAL_SUFFIX_YIN:
        return new PersonalSuffixSignature();
    }

    throw new IllegalArgumentException("invalid signature type.");
  }
}
